package com.qinhailin.web;


import com.jfinal.kit.Ret;
import com.jfinal.upload.UploadFile;
import com.qinhailin.common.base.BaseController;
import com.qinhailin.common.routes.ControllerBind;

import java.util.List;

@ControllerBind(path="/web/index")
public class indexController extends BaseController {

    public void index(){
        render("index.html");
    }

    /**
     * 上传文件,可多附件上传
     *
     * @author QinHaiLin
     * @date 2018年8月1日
     */
    public void upload() {
        List<UploadFile> uploadList = getFiles();
        String objectId = getPara() == null ? getPara("objectId") : getPara();
        List<String> url = saveFiles(uploadList, objectId);
        renderJson(Ret.ok("url", url));
    }

}
